﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Spoergeskema
{
    public partial class Default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                MultiView1.ActiveViewIndex = 0;
            }
            
            if (Page.IsPostBack)
            {
                string uiName = name.Text;
                string uiAdress = adress.Text;
                string uiPhone = phone.Text;

                string resultOne = "Navn: <span>" + uiName + "</span> Adresse: <span>" + uiAdress + "</span> Telefon: <span>" + uiPhone + "</span>";
                
                string resultTwo = "<ul>";

                if (rock.Checked) resultTwo += "<li>Rock</li>";
                if (pop.Checked) resultTwo += "<li>Pop</li>";
                if (jazz.Checked) resultTwo += "<li>Jazz</li>";
                if (rAndB.Checked) resultTwo += "<li>R&B</li>";
                if (hiphop.Checked) resultTwo += "<li>Hiphop</li>";
                if (house.Checked) resultTwo += "<li>House</li>";
                if (techno.Checked) resultTwo += "<li>Techno</li>";

                resultTwo += "</ul>";

                string uiListenPrWeek = listenPrWeek.SelectedItem.Value;

                if (MultiView1.ActiveViewIndex == 2) {
                    Panel1.Controls.Add(new LiteralControl(resultOne));
                    Panel2.Controls.Add(new LiteralControl(resultTwo));
                    Panel3.Controls.Add(new LiteralControl(uiListenPrWeek));
                }
               
            }
        }
        protected void ViewOneSubmit(object sender, EventArgs e)
        {
            MultiView1.ActiveViewIndex = 1;
        }
        protected void ViewTwoSubmit(object sender, EventArgs e)
        {
            MultiView1.ActiveViewIndex = 2;
        }
        protected void ViewThreeSubmit(object sender, EventArgs e)
        {
            MultiView1.ActiveViewIndex = 3;
        }
    }
}